
<%@include file="/commons/decelerations.jsp" %>
<c:set var="submitButtonName"><c:choose>
	<c:when test='${action eq "CreatePerson"}'>Create Person</c:when>
	<c:otherwise>Maintain Person</c:otherwise>
</c:choose></c:set>

<form action="${action}" method="post" id="form">
	<table>
		<c:choose>
       		<c:when test='${action eq "CreatePerson"}'>
       			<tr><td width="120px">Person Id</td><td><input type="text" id = "personId" name="personId" value="${person.personId}"/></td></tr>
       		</c:when>
       		<c:otherwise>
       			<tr><td width="120px">Person Id</td><td><input type="text" id = "personId" name="personId" value="${person.personId}" readonly="readonly"/></td></tr>
       		</c:otherwise>
     	</c:choose>
       
       	<tr><td>First Name</td><td><input type="text" id = "firstName" name="firstName" value="${person.firstName}"/></td></tr>
       	<tr><td>Last Name</td><td><input type="text" id = "lastName" name="lastName" value="${person.lastName}"/></td></tr>
    </table>
    <table>
       	<tr><td>Role</td>
       		<c:forEach var="role" begin="0" items="${requestScope.roleList}">
       			<td>
       				<input type="checkbox" id="${role.roleId}" name="roleName" value="${role.roleId}"/><label for="${role.roleId}">${role.roleId}</label>
       			</td>
       		</c:forEach>
        </tr>       	
       	<tr>
       		<td><input type="submit" name = "button" value="${submitButtonName}"/></td>
       		<td><button type="reset">Reset</button></td>
       	</tr>
   	</table>
</form>
